﻿using DAL;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BLL
{
    public class UserManage
    {
        //搜索业务
        public static List<UserModel> GetUserListBySearch(string str)
        {
            return UserService.GetUserModelsBySearch(str);
        }

        //编辑跟新客户信息业务
        public static bool SaveClient(UserModel model)
        {
            return UserService.UpdateClient(model);
        }

        //通过客户号查询客户信息业务
        public static UserModel GetUserByClientID(string clientid)
        {
            return UserService.GetUserModelByClientid(clientid);
        }

        //销卡
        public static bool XiaoKa(string cardid)
        {
            return UserService.DelAccountByCardID(cardid);
        }

        //开户业务
        public static bool KaiHu(UserModel model)
        {
            return UserService.AddUser(model);
        }

        //登录业务
        public static UserModel DoLogin(string carID, string pwd)
        {
            return UserService.GetUserModelByCarIDAndPwd(carID, pwd);
        }

        //用户列表分页
        public static List<UserModel> GetUserListWithPage(int pageIndex, int pageSize)
        {
            return UserService.GetUserModelsWithPage(pageIndex, pageSize);
        }

        //获取用户列表业务
        public static List<UserModel> GetUserList()
        {
            return UserService.GetUserModels();
        }
    }
}